/* 
 * File:   RrefGaussian.h
 * Author: gustavo
 *
 * Created on August 19, 2012, 2:03 AM
 */

#ifndef RREFGAUSSIAN_H
#define	RREFGAUSSIAN_H

#include "../impl/mtf/rref_gaussian.hpp"

#include "Rref.h"

namespace imp {

	namespace math {

		struct Rref_GaussianElimination;

		/* = Implements DecompositionInterface< Matrix<T> > ===================== */
		template <> void Rref< double, Rref_GaussianElimination >::transform(Matrix<double>& M) {

			double * null_space;

			impl::rref_gaussian(M.rows, M.columns, M.data, Ind.data, &null_space, &rank);

			if ((M.columns - rank) > 0) {
				this->N.setData(M.columns, M.columns - rank, null_space, R.columns - rank);
			}


		}

		template <> bool Rref< double, Rref_GaussianElimination >::modifiedInput() const {
			return false;
		}

	}
}

#endif	/* RREFGAUSSIAN_H */

